package Test;

/**
 * @leiwenkang 2018-02-24 15:01.
 */
public class AdCommonConst {
    public static class GaussianBlurConst {
        public static final int CORE_POOL_SIZE = 4;
        public static final int MAX_POOL_SIZE = 6;
        public static final int WORK_QUEUE_SIZE = 1000;

        public static final int GS_RADIUS;
        public static final double[][] GS_KERNEL;

        static {

            // 高斯核
            int tmpRadius = 540, size = 2 * tmpRadius + 1, sigma = 200;
            double[][] tmpGsKernel = new double[size][size];
            try {
                for (int r = -tmpRadius; r < tmpRadius; ++r) {
                    for (int c = -tmpRadius; c < tmpRadius; ++c) {
                        tmpGsKernel[r + tmpRadius][c + tmpRadius] = Math.exp(-(r * r + c * c) / (2 * sigma * sigma));
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
            GS_RADIUS = tmpRadius;
            GS_KERNEL = tmpGsKernel;
        }
    }
}
